package cn.itrip.auth.service;


import org.springframework.mail.MailMessage;
import org.springframework.mail.MailSender;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service("mailService")
public class MailServiceImpl implements MailService {
    @Resource
    private SimpleMailMessage simpleMailMessage;
    @Resource
    private MailSender mailSender;
    @Override
    public void sendActivationMail(String mailto, String ativationCode) {
        simpleMailMessage.setTo(mailto);
        simpleMailMessage.setText("您的激活码是:"+ativationCode);
        mailSender.send(simpleMailMessage);
    }
}
